package com.rc.evcharger.service.rc;

import com.rc.evcharger.mapper.rc.RcEnterpriseGainRecordMapper;
import com.rc.evcharger.model.rc.RcEnterpriseGainRecord;
import com.rc.evcharger.model.rc.RcEnterpriseGainRecordExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RcEnterpriseGainRecordServiceImpl implements RcEnterpriseGainRecordService {
    @Autowired
    private RcEnterpriseGainRecordMapper rcEnterpriseGainRecordMapper;

    @Override
    public RcEnterpriseGainRecordMapper getMapper() {
        return rcEnterpriseGainRecordMapper;
    }

    @Override
    public List<RcEnterpriseGainRecord> listCurrentByMemberId(Long memberId) {
        RcEnterpriseGainRecordExample example = new RcEnterpriseGainRecordExample();
        example.createCriteria().andMemberIdEqualTo(memberId).andStatusEqualTo("0");
        example.setOrderByClause("created_time desc");
        return rcEnterpriseGainRecordMapper.selectByExample(example);
    }
}
